<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Seamless Scrolling Example</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      margin: 0;
      padding: 0;
    }
    #content {
      margin: 20px;
    }
    .item {
      background-color: #f4f4f4;
      margin: 10px 0;
      padding: 20px;
      border-radius: 5px;
    }
  </style>
</head>
<body>
  <div id="content"></div>

  <script>
    // 模拟数据
    let itemCount = 0;

    // 创建一个新的内容项
    function createItem() {
      itemCount++;
      const item = document.createElement('div');
      item.className = 'item';
      item.textContent = `Item ${itemCount}`;
      document.getElementById('content').appendChild(item);
    }

    // 加载初始内容
    for (let i = 0; i < 10; i++) {
      createItem();
    }

    // 检测滚动事件并加载更多内容
    window.onscroll = () => {
      if (window.innerHeight + window.scrollY >= document.body.offsetHeight) {
        // 页面滚动到底部时加载更多内容
        for (let i = 0; i < 5; i++) {
          createItem();
        }
      }
    };
  </script>
</body>
</html>
